home *** CD-ROM | disk | FTP | other *** search
/ PC Users 1998 June / Cd Pc Users 9.iso / prog / inst / ssaver / scrnsave.bas < prev    next >
Encoding:
BASIC Source File  |  1995-11-29  |  1.0 KB  |  46 lines

  1. Declare Function ShowCursor Lib "USER" (ByVal fShow As Integer) As Integer
  2.  
  3. Sub CenterForm (frm As Form)
  4. Dim x As Integer, y As Integer        'New directions for the form
  5.         
  6.         x = (screen.Width - frm.Width) / 2
  7.         y = (screen.Height - frm.Height) / 2
  8.         frm.Move x, y       'Change the location of the form
  9.  
  10. End Sub
  11.  
  12. Sub EndScrnsave ()
  13.     SHOWMOUSE                   ' Make mouse pointer visible again
  14.     End                         ' And exit
  15. End Sub
  16.  
  17. Sub HideMouse ()
  18.     While ShowCursor(False) >= 0
  19.     Wend
  20. End Sub
  21.  
  22. Sub main ()
  23.     '
  24.     '
  25.     ' Check to see if we should blank the screen, or display
  26.     ' the Setup dialog box.
  27.     '
  28.     If InStr(Command$, "/c") Then
  29.         SetupForm.Show 1
  30.     ElseIf InStr(Command$, "/s") Then
  31.         BlankForm.Show
  32.     End If
  33.  
  34.     '
  35.     ' Wait until there are no form visible, then quit.
  36.     '
  37.     While DoEvents() > 0        ' Loop until no forms visible
  38.     Wend
  39. End Sub
  40.  
  41. Sub SHOWMOUSE ()
  42.     While ShowCursor(True) < 0
  43.     Wend
  44. End Sub
  45.  
  46.